package com.example.kehoobackend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.kehoobackend.common.CommonResponse;
import com.example.kehoobackend.domain.Answer;

import java.util.List;

public interface AnswerService extends IService<Answer> {


    //查询某问题的所有回答
    CommonResponse<List<Answer>> getAnswerByQuestionId(Integer question_id,Integer user_id);

    //查询某用户的所有回答
    CommonResponse<List<Answer>> getAnswerByUserId(Integer user_id);

    //新增回答
    Answer addAnswer(Answer answer);

    //删除回答
    boolean deleteAnswer(Integer answer_id);


    //点赞回答
    boolean like(Integer answer_id,Integer user_id);

    //取消点赞
    boolean cancelLike(Integer answer_id,Integer user_id);

    //某用户是否已点赞某回答
    boolean isLike(Integer answer_id, Integer user_id);

    //获取某个回答的评论数
    Integer getCommentCount(Integer answer_id);

    CommonResponse<List<Answer>> getAllAnswer();
}
